/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import entity.SystemM;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JOptionPane;

/**
 *
 * @author ian
 */
public class DataInputControl {

    public List<SystemM> register = new ArrayList<>();

    public DataInputControl(List<SystemM> Register) {
        register = Register;
    }

    public String inputData(float temp, float pressure, float pluviosity) {
        String outLine = "Datos Correctos";
        SystemM entry = new SystemM();
        try {            
            entry.setTemperature(temp);            
            entry.setAtmPressure(pressure);           
            entry.setPluviosity(pluviosity);
            register.add(entry);
        } catch (NumberFormatException nfe) {            
            outLine = "Datos Inválidos " + nfe.getMessage();
        }
        return outLine;
    }
}
